//package com.he.hsdyc.config.wechatmini;
//
//import com.szdtoo.common.utils.DateUtil;
//import com.szdtoo.common.utils.JSONUtils;
//import com.szdtoo.common.utils.ValidateUtils;
//import com.szdtoo.handle.PushHandler;
//import com.szdtoo.mapper.PushParentMapper;
//import com.szdtoo.mapper.PushPrincipalMapper;
//import com.szdtoo.model.push.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.UnsupportedEncodingException;
//import java.net.URLEncoder;
//import java.util.Date;
//
///**
// * 微信小程序推送
// * @time 2019/07/10
// */
//@Component
//public class WechatMiniAppHandler {
//
//    @Autowired
//    private WxPushService wxPushService;
//
//
//	@Override
//	public void personalAccountRecharge(String content) {
//		PersonalAccount personalAccount = JSONUtils.toBean(content, PersonalAccount.class);
//		try {
//			if (!ValidateUtils.isIllegalString(personalAccount.getOpenId())) {
//				String studentName = URLEncoder.encode(personalAccount.getStuName(), "UTF-8");
//				String rechargeAmount=URLEncoder.encode(personalAccount.getRechargeAmount()+"元", "UTF-8");
//				String givenAmount=URLEncoder.encode(personalAccount.getDonationAmount()+"元", "UTF-8");
//				String remark=URLEncoder.encode(personalAccount.getRemark(), "UTF-8");
//				String parentRemark=URLEncoder.encode(personalAccount.getParentRemark(), "UTF-8");
//                String time = URLEncoder.encode(ValidateUtils.isIllegalString(personalAccount.getRechargeTime())? DateUtil.getNowTime():personalAccount.getRechargeTime(), "UTF-8");
//
//
////
////				Map<String, TemplateData> data = new HashMap<>();
////                //拼接模板信息
////                data.put("keyword1", new TemplateData(studentName, "#173177"));
////                data.put("keyword2", new TemplateData(rechargeAmount, "#173177"));
////                data.put("keyword3", new TemplateData(givenAmount, "#173177"));
////                data.put("keyword4", new TemplateData(time, "#173177"));
////                data.put("remark", new TemplateData(remark, "#173177"));
////
////                wxPushService.pushMessage("parent",personalAccount.getOpenId(),"pPiU617W9s8y7_m4k8h1DfBuAk09bxkT1OVrhthbymc",data);
//
//			}
//		} catch (UnsupportedEncodingException e) {
//			e.printStackTrace();
//		}
//
//	}
//
//}
